import 'package:flutter/material.dart';
import 'package:power_house/util/common_toast.dart';
import '../scoped_model/auth.dart';
import '../util/scoped_model_helper.dart';

class SettingPage extends StatelessWidget {
  const SettingPage({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: const Text('设置'),
      ),
      body: ListView(
        children: [
          ElevatedButton(
              onPressed: () {
                ScopedModelHelper.getModel<AuthModel>(context).logout();
                CommonToast.showToast('退出登录');
              },
              child: const Text('退出登录'))
        ],
      ),
    );
  }
}
